package com.hnguigu.service.Impl;

import com.hnguigu.mapper.UsersMapper;
import com.hnguigu.pojo.Users;
import com.hnguigu.service.AccService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AccServaiceImpl implements AccService {
    @Autowired
    UsersMapper mapper;

    public Users selectByPrimaryKey(String username) {
        return mapper.selectByPrimaryKey(username);
    }

    //当前用户具有admin角色可以被访问
    @RequiresRoles(value = {"admin"})
    public void t1() {
        System.out.println("t1进来了");
    }

    public void t2() {
        System.out.println("t2进来了");
    }
    //操作权限
    @RequiresPermissions("user:del")
    public void t3() {
        System.out.println("用户删除");
    }
    @RequiresPermissions("user:find")
    public void t4() {
        System.out.println("用户查询");
    }

}
